<?php
/*
 * Created on Jul 16, 2009
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
?>
<?php


class Model_gallery extends Model {
	var $_tbl_name;

	function Model_gallery() {
		// Call the Model constructor
		parent :: Model();
		$this->_tbl_name = "tbl_gallery";
	}

	function find_by_group($group_id, $order_by = "id", $type = "ASC") {
		$this->db->where("grup", $group_id);
		$this->db->order_by($order_by, $type);
		$query = $this->db->get($this->_tbl_name);
		//echo $this->db->last_query();
		if ($query->num_rows() > 0) {
			return $query->result_array();
		}
		return null;
	}
}
?>